package entity;

import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name = "prog_role")
public class Role {

	private Long id;
	private String name;

	// private Set<Role> group;

	public Role() {
	}

	// public Role(String name, Set<Role> group) {
	// super();
	// this.name = name;
	// this.group = group;
	// }

	public Role(String name) {
		super();
		this.name = name;
	}

	@Id
	@SequenceGenerator(name = "Role_gen", sequenceName = "Role_index")
	@GeneratedValue(generator = "Role_gen", strategy = GenerationType.SEQUENCE)
	@Column(insertable = false, updatable = false)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	// public Set<Role> getGroup() {
	// return group;
	// }
	//
	// public void setGroup(Set<Role> group) {
	// this.group = group;
	// }

	// @Override
	// public String toString() {
	// return "Role [id=" + id + ", name=" + name + ", group=" + group + "]";
	// }

	@Override
	public String toString() {
		return "Role [id=" + id + ", name=" + name + "]";
	}
}
